import Vue from 'vue'
import App from './App'

// vuex
import store from './store'

// 引入全局uView
import uView from '@/uni_modules/uview-ui'
//全局引入 DictTag
import DictTag from 'components/dict/dict.vue'

Vue.component('DictTag',DictTag)


//判断是否登录的方法
import isLogin from "@/util/isLogin.js"
Vue.prototype.$isLogin = isLogin

//注入自定义正则验证规则
import reg from "@/util/reg.js"
Vue.prototype.$reg = reg
import api from '@/api/index.js'
Vue.prototype.$api = api

import mixin from './common/mixin'
//引入全局字典插件
import dict from '@/plugin/dict'
dict.install(Vue)
import { getDict } from '@/api/common.js'//全局字典接口
Vue.prototype.$getDict = getDict
//引入storage
import storage from 'util/storage.js'

Vue.prototype.$storage = storage

Vue.prototype.$store = store

Vue.config.productionTip = false

App.mpType = 'app'
Vue.use(uView)

// #ifdef MP
// 引入uView对小程序分享的mixin封装
const mpShare = require('@/uni_modules/uview-ui/libs/mixin/mpShare.js')
Vue.mixin(mpShare)
// #endif

Vue.mixin(mixin)

const app = new Vue({
    store,
    ...App
})

// 引入请求封装
require('./util/request/index')(app)

app.$mount()
